<?php
/**
 * 此装饰器只针对我们登录
 */
namespace app\admin\Decorate;
use app\admin\Imp\ImpDecorate;
use think\Session;
class PreparedUid implements  ImpDecorate
{

 public function beforeDecorate()
 {
     // TODO: Implement beforeDecorate() method.
 }

    /**
     * @return  |-设置成功返回true
     */

    public function endDecorate(){

        if(false===Session::has('UID'))
        {
                return false;
        }
        //为了安全每次会变换当前的session_id的值
        $uid                        =   Session::get('UID');
        if(false===defined('UID')){  define('UID',$uid);}
        return true;
    }

}